﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="A_Bankroll.aspx.cs" Inherits="QD.Weijie.Web.Passport.A_Bankroll" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>交易记录-管理后台</title>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <link href="css/base.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.1.js" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <script src="js/Pager.js" type="text/javascript"></script>
    <script src="js/Toast.js" type="text/javascript"></script>
    <style type="text/css">   
    .contenthead{width: 940px;height: 60px;margin-left: auto;margin-right: auto;margin-top: 6px;overflow: hidden;background-color: #E4E4E4;padding-left: 30px;}
    .menu0{width: 970px;margin-left: auto;margin-right: auto;overflow: hidden;padding-top: 15px;}
    #menu0 ul{margin: 0px;padding: 0px;list-style: none;margin-left: -5px;}
    #menu0 ul li{margin: 0px;padding: 0px;list-style: none;margin-left: -5px;}
    #menu0 ul{height: 45px;border-bottom: 1px solid #F37F12;}
    #menu0 ul li{background-color: #EDEDED;width: 175px; font-size:16px; height: 44px;border: 1px solid #ccc;border-bottom: none;text-align: center;line-height: 42px;float: left;color: #2C2B30;font-weight: 800;margin-left: 5px;cursor: pointer;}
    #menu0 ul li.hover{height: 45px;background-color: white;color: #F47D09  ;border: 1px solid #F37F12;border-bottom: none;cursor: pointer;}
    .menu0 .reg {padding: 0 20px 0 20px;line-height: 40px;margin-top: 0px;font-size: 20px;color: red;text-decoration: none;cursor: pointer;display: block;font-weight: 100;border: 1px solid #ccc;border-radius: 5px 5px 5px 5px;}
    #user_ad {margin-top: 13px;color: #333;font-size: 16px;font-weight: 100;}
    .bodyone{width: 1000px;background-color: White;margin-left: auto;margin-right: auto;overflow: hidden;margin-top: 6px;min-height:870px;margin-bottom: 10px;}
    .bodyhead{width: 970px;height: 65px;background-color: #E4E4E4;margin-left: auto;margin-right: auto;margin-top: 10px;color: #243456;margin-top: 6px;}
    .main{width: 970px;margin-left: auto;margin-right: auto;overflow: hidden;margin-top: 20px;}
    .tabs{text-align: center;}
    .tabs tr{height: 60px;}
    .table1{margin-top:15px;border-collapse: collapse;border: 1px solid #EDEDED;}
    .table1 th, tr, td{border: 1px solid #EDEDED;text-align: center; font-size:16px;}
    .table1 td{ color:#666; }
    .tab_nav{width:970px; margin:15px 15px 0 15px;}
    .pager_style{ margin-left:15px;}
    </style>
    <script>
        var pager = new Pager();
        $(document).ready(function () {
            $(".tab_li").bind("click", function () {
                $(".tab_li").removeClass("tab_li_ck");
                $(this).addClass("tab_li_ck");
                tab_ck($(this).attr("tag")); //在此添加点击事件
            });
            GetList(1);
        });

        var tag_cerent = "tab1";
        function tab_ck(tag) {
            tag_cerent=tag;
            $("#tab1").addClass("none");
            $("#tab2").addClass("none");
            $("#tab3").addClass("none");
            $("#" + tag).removeClass("none");
            GetList(1);
        }

        //显示列表
        function GetList(page) {
            if (wait.isShow) return;
            var type = 0;
            if (tag_cerent == "tab2")
                type = 1;
            else if (tag_cerent == "tab3")
                type = 2;

            $.get("ajax/bankroll.ashx?getlist", { type: type, page: page }, function (json) {
                var tbody = $("#tbody_" + tag_cerent);
                $(tbody).empty();
                $(".pager_style").removeClass("none");
                if (json.code != 0) {
                    $(tbody).append("<tr><td colspan=5>" + json.msg + "</td></tr>");
                    $(".pager_style").addClass("none");
                    return;
                }
                var list = json.item.table;
                if (list.length == 0)
                    $(tbody).append("<td colspan='5' style='height:60px;'>没有记录</td>");
                for (var i in list) {
                    var d = "";
                    if (list[i].direction == 1)
                        d = "收入"
                    else if (list[i].direction == 2)
                        d = "支出";
                    $(tbody).append("<tr id = " + list[i].id + "><td>" + GetDate(list[i].addtime) + "</td>" +
                    "<td>" +  list[i].amount + "</td>" +
                    "<td>" + list[i].balance + "</td>" +
                    "<td class='col4'>" + d + "</td>" +
                    "<td>" + list[i].remarks + "</td></tr>");
                }
                pager.initPage(page, json.item.itemCount, json.item.pageSize, 5, GetList);
            }, "json");
        }
        function GetDate(time) {
            var date = new Date(time);
            return date.format("yyyy-MM-dd hh:mm:ss");
        }
        Date.prototype.format = function (format) {
            var o = {
                "M+": this.getMonth() + 1, //month  
                "d+": this.getDate(),    //day  
                "h+": this.getHours(),   //hour  
                "m+": this.getMinutes(), //minute  
                "s+": this.getSeconds(), //second  
                "q+": Math.floor((this.getMonth() + 3) / 3),  //quarter  
                "S": this.getMilliseconds() //millisecond  
            }
            if (/(y+)/.test(format))
                format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            for (var k in o)
                if (new RegExp("(" + k + ")").test(format))
                    format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
            return format;
        }
    </script>
</head>
<body>
    <!--#include file="uc/top.html" -->
    <div class="bodyone">
       <div class="contenthead">
           <div id="user_ad"></div>
       </div>
        <div class="tab_nav">
            <ul class="tab_ul">
                <li tag="tab1" class="tab_li tab_li_ck">所有记录</li>
                <li tag="tab2" class="tab_li">收入记录</li>
                <li tag="tab3" class="tab_li">支出记录</li>
            </ul>
        </div>
        <form id="form1" runat="server">
        <div class="main" id="main0">
            <div id="tab1" tag="tab" class="div_list_up">
                <table class="table1" id="con_row_1">
  
                        <tr style="text-align: center; color: #56555A; height: 60px; border: 1px solid  red;">
                            <th style="width: 180px;">
                                时间
                            </th>
                            <th style="width: 153px;">
                                金额
                            </th>
                            <th style="width: 150px;">
                                余额
                            </th>
                            <th style="width: 105px;">
                                类型
                            </th>
                            <th style="width: 382px; text-align: left; padding-left: 10px;">
                                备注
                            </th>
                        </tr>
        
                    <tbody id="tbody_tab1" class="tabs">
                    </tbody>
                </table>
            </div>
            <div id="tab2" tag="tab" class="none">
                <table class="table1" id="con_row_2">      
                        <tr style="text-align: center; color: #56555A; height: 60px; border: 1px solid  red;">
                            <th style="width: 180px;">
                                时间
                            </th>
                            <th style="width: 153px;">
                                金额
                            </th>
                            <th style="width: 150px;">
                                余额
                            </th>
                            <th style="width: 105px;">
                                类型
                            </th>
                            <th style="width: 382px; text-align: left; padding-left: 10px;">
                                备注
                            </th>
                        </tr>
                    <tbody id="tbody_tab2" class="tabs">
                    </tbody>
                </table>
            </div>
            <div id="tab3" class="none">
                <table class="table1" id="con_row_3">
                        <tr style="text-align: center; color: #56555A; height: 60px; border: 1px solid  red;">
                            <th style="width: 180px;">
                                时间
                            </th>
                            <th style="width: 153px;">
                                金额
                            </th>
                            <th style="width: 150px;">
                                余额
                            </th>
                            <th style="width: 105px;">
                                类型
                            </th>
                            <th style="width: 382px; text-align: left; padding-left: 10px;">
                                备注
                            </th>
                        </tr>
                    <tbody id="tbody_tab3" class="tabs">
                    </tbody>
                </table>
            </div>
        </div>

        <div class="pager_style">
                    <ul class="page_num"></ul>
                    <ul class="page_info">
                        <li>总数:<span id="count">50</span></li>
                        <li>每页:<span id="pageSize">10</span></li>
                        <li>页数:<span id="pageToal">5</span></li>
                    </ul>
                </div>
        </form>
    </div>
      <!--#include file="uc/Footer_Agent.html" -->
</body>
</html>
